package org.mii.safeguard_v1.base.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name = "ct_network_b")
//默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class CtNetworkB extends IdEntity {
	private String name;
	private CtNetworkA ctNetworkA;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
	@JoinColumn(name = "Network_A_id")
	public CtNetworkA getCtNetworkA() {
		return ctNetworkA;
	}

	public void setCtNetworkA(CtNetworkA ctNetworkA) {
		this.ctNetworkA = ctNetworkA;
	}
}
